<!-- /* Description for file.
 * 公司设置
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/systemconfigs
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张朋2011年0630
 * @lastmodified  张朋2011年0721
 */
 -->


<?php
echo $html->css ( 'tab' );
echo $html->css ( 'jquery-validate/css/screen' );
?>
<style type="text/css">
.sysfont
{
	font-size:12px;
}
</style>

<script type="text/javascript">
//图片预览
 $(document).ready(function() {
	$("#pre").click(function() {
		var defaultlogo = $("#imgUrl").attr();
		if($("#logourl").val()!='')
		{
			var url = "file:///" + $("#logourl").val();
			$("#imgUrl").attr('src',url);
		} else {
			$("#imgUrl").attr('src',defaultlogo);
		}
	});
});

//Form验证
 $(document).ready(function() {
 	 $.validator.setDefaults({       
 		 submitHandler: function(form) {    
 		  form.submit();    
 		}       
 	});   
 			
 	// validate signup form on keyup and submit
 	$("#SystemconfigEditForm").validate({
 		rules: {
 		"data[Systemconfig][chineseName]": {required: true ,string:true,chcharacter:true,stringMinLength:0,stringMaxLength:50},
 		"data[Systemconfig][englishName]": {required: true ,stringMinLength:0,stringMaxLength:100},
 		"data[Systemconfig][tel]": {  required: false ,phone:true},
 		"data[Systemconfig][fax]": {  required: false ,fax:true},
 		"data[Systemconfig][companyUrl]": {	required: false},
 		"data[Systemconfig][companyEmail]": {  required: false},
 		"data[Systemconfig][systemTitle]": {  required: false ,string:true,rangelength:[0,50]},
 		"data[Systemconfig][systemLogo]": {  required: false,accept: "png|gif|jpeg|jpg" },
 		"data[Systemconfig][copyright]": {  required: false,rangelength:[0,100]}
 		},
 		messages: {
 			"data[Systemconfig][systemLogo]":{accept: "请输入拥有合法后缀名的字符串(*.png|*.jpe?g|*.gif)"}
 		}, 
 		//设置验证触发事件 
 		focusInvalid: false, 
 		onkeyup: false, 
 		//设置错误信息提示DOM  
 		errorPlacement: function(error, element) { 
 		error.appendTo( element.parent()); 
 		}
 		
 		}); 
 });
</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Systemconfigs');//一级目录
										   echo '>';echo __('Othersetting');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Companyset',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->


<div class="tabflex">
<!-- 上传form开始 -->
<?php echo $form->create('Systemconfig',array('action'=>'edit','type'=> 'post','enctype'=>'multipart/form-data'));?>
<fieldset><legend><?php __('Companyset');//公司设置?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs chineseName'); //中文简称?>：<font color="red">*</font></td>
		<td class="sysfont"><?php echo $form->text('chineseName',
			array('size' => 100,'id'=>'chineseName','default'=>$data['Systemconfig']['chineseName'])); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs englishName'); //英文简称?>：<font color="red">*</font></td>
		<td class="sysfont"><?php echo $form->text('englishName',
			array('size' => 100,'id'=>'englishName','default'=>$data['Systemconfig']['englishName'])); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs tel'); //联系电话?>：</td>
		<td class="sysfont"><?php echo $form->text('tel',
			array('size' => 100,'id'=>'tel','default'=>$data['Systemconfig']['tel'])); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs fax'); //联系传真?>：</td>
		<td class="sysfont"><?php echo $form->text('fax',
			array('size' => 100,'default'=>$data['Systemconfig']['fax'])); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs companyUrl'); //公司网站?>：</td>
		<td class="sysfont"><?php echo $form->text('companyUrl',
			array('size' => 100,'id'=>'companyUrl','default'=>$data['Systemconfig']['companyUrl'])); ?>
		</td>
	</tr>
		<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs companyEmail'); //公司邮箱?>：</td>
		<td class="sysfont"><?php echo $form->text('companyEmail',
			array('size' => 100,'id'=>'companyEmail','default'=>$data['Systemconfig']['companyEmail'])); ?>
		</td>
	</tr>
		<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs medioImage'); //多媒体连接图片?>：</td>
		<td class="sysfont"><?php echo $form->text('medioImage',
			array('size' => 100,'id'=>'medioImage','id'=>'medioImage','default'=>$data['Systemconfig']['medioImage'])); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs systemTitle'); //系统Title?>：</td>
		<td class="sysfont"><?php echo $form->text('systemTitle',
			array('size' => 100,'id'=>'systemTitle','default'=>$data['Systemconfig']['systemTitle'])); ?>
		</td>
	</tr>
		<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs systemLogo');//系统logo?>：</td>
		<td class="sysfont"><?php echo $form->file('systemLogo',array('class' => 'TextBoxL','id'=>'logourl','size'=>50,'name'=>'systemLogo')); ?>
		</td>
	</tr>
	<tr>
		<td width="100"></td>
		<td width="100" class="sysfont"><?php __('Systemconfigs copyright'); //版权信息等?>：</td>
		<td class="sysfont"><?php echo $form->text('copyright',
			array('size' => 100,'id'=>'copyright','default'=>$data['Systemconfig']['copyright'])); ?>
		</td>
	</tr>

	<!-- 图片预览 -->
	<tr>
		<td width="100"></td>
		<td width="100"></td>
		<td>
			<div>
				<img alt="系统Logo" height="57" src="../img/<?php echo $style;?>-main/toplogo.gif" id="imgUrl"/>
			</div>
		</td>
	</tr>
	<!-- //图片预览 -->
	
	
<!--操作按钮-->
	<tr>
		<td width="100"></td>
		<td width="100"></td>
		<td>
		<table width="40%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td width="40px">
				<?php echo $form->button('预览',array('type'=>'button','class'=>'preview','id'=>'pre'));?> 
				</td>
				<td width="100px">
					<?php echo $form->button('确定',array('type'=>'submit','class'=>'addsubmit'));?> 			
				<!-- __('Add', true)增加--></td>
				<td width="100px">
					<?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>
				<!-- __('reset', true)取消--></td>
			</tr>
		</table>
		</td>
	</tr>
<!--//操作按钮-->
</table>
</fieldset>
<?php echo $form->end();?>
<!-- 上传form结束 -->